package com.weimei.conversionTreasure.viewModel;

import android.os.Bundle;

import androidx.annotation.NonNull;
import androidx.databinding.ObservableField;

import com.weimei.conversionTreasure.activity.JyDetailActivity;
import com.weimei.conversionTreasure.http.entity.YMonthDetailBean;

import me.goldze.mvvmhabit.base.BaseViewModel;
import me.goldze.mvvmhabit.base.ItemViewModel;
import me.goldze.mvvmhabit.binding.command.BindingAction;
import me.goldze.mvvmhabit.binding.command.BindingCommand;

public class YMonthDetailItemIVM extends ItemViewModel {
    public ObservableField<YMonthDetailBean.DataDTO.RDayDTO.DealDataDTO> entity = new ObservableField<>();


    public YMonthDetailItemIVM(@NonNull BaseViewModel viewModel, YMonthDetailBean.DataDTO.RDayDTO.DealDataDTO bean) {
        super(viewModel);
        entity.set(bean);
    }

    public BindingCommand itemClick = new BindingCommand(new BindingAction() {
        @Override
        public void call() {
            Bundle bundle = new Bundle();
            bundle.putString("id",entity.get().getId()+"");
            viewModel.startActivity(JyDetailActivity.class,bundle);
        }
    });
}
